/**
 Signal and Slot for Java
 Copyright (C) 2003 Thia Yeo Ching (tycordinal@yahoo.co.uk)
 http://sourceforge.net/projects/javasignalslot/

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package org.arclib.examples.signal; 

import org.arclib.signal.*; 

/**
 * Author: Thia Yeo Ching, tycordinal@yahoo.co.uk
 * Date: Mar 26, 2003
 * Time: 2:57:48 AM
 */
public class TestSignal2
{
  public static void main(String args[])
  {
    Producer p = new Producer();
    IntObject io = new IntObject(0);
    io.o = 1;

    StringObject so = new StringObject();
    so.o = "hello";

    NeedInt ni = new NeedInt();

    SignalSlotMap.connect(p, Producer.INT_SIGNAL, SlotProviderMethodPair.create(ni, "setIntObject", IntObject.class) );

    p.doEmit("Test"); 
  }
}

class Button implements ISignalProvider, ISlotProvider
{
	
	
	void clicked()
	{
		SignalSlotMap.emit(this, "button", (Object)new IntObject(3));
	}
	
	
}

/***
1st emit: to all
NeedInt:got Int:1
NeedAll:got Int:1
NeedString:got String:hello
NeedAll:got String:hello
NeedAll:Yes i am awake!
emit xio
NeedInt:got Int:2
NeedAll:got Int:2
2nd emit: to ns and na
NeedAll:got Int:1
NeedString:got String:hello
NeedAll:got String:hello
NeedAll:Yes i am awake!
3rd emit: only to na
NeedAll:got Int:1
NeedAll:got String:hello
NeedAll:Yes i am awake!
4th emit: to na, no setStringObject
NeedAll:got Int:1
NeedAll:Yes i am awake!
5th emit: to no one
Emit primitives:1
WantPrimitive.give:int:3
WantPrimitive.doNothing:called
Emit primitives:2
WantPrimitive.doNothing:called
Emit primitives:3
Process terminated with exit code 0
 ***/